import { PicEntity } from './entities/pic.entity';
import { PicClassifyEntity } from './entities/picClassify.entity';
import { Module } from '@nestjs/common';
import { PicClassifyModule } from './pic-classify/pic-classify.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import { PicsModule } from './pics/pics.module';
import { SpecModule } from './spec/spec.module';
import SpecEntity from './entities/spec.entity';

@Module({
  imports: [
    PicClassifyModule,
    TypeOrmModule.forRoot({
      type: 'mysql',
      host: 'localhost',
      port: 3306,
      username: 'root',
      // password: '1234', // 本地数据库密码
      password: 'password',  // linux数据库密码
      database: 'test',
      entities: [PicClassifyEntity, PicEntity, SpecEntity],
      synchronize: true,
    }),
    PicsModule,
    SpecModule,
  ],
})
export class AppModule {}
